Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add regex validation #420

Merged
merged 1 commit into from
Oct 13, 2024
Merged

add regex validation #420

merged 1 commit into from
Oct 13, 2024

Conversation

michaelfeil
Copy link
Owner

@michaelfeil michaelfeil commented Oct 12, 2024

Closes #418

This pull request to libs/infinity_emb/infinity_emb/infinity_server.py includes changes to enhance URL validation and improve command-line interface behavior. The most important changes include adding a new URL validation function, integrating this validation into the url_prefix option, and ensuring required parameters are marked for the CLI.

Enhancements to URL validation and CLI behavior:

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This pull request adds regex validation for URL paths in the infinity_server.py file, enhancing the API's robustness and ensuring proper URL formatting.

  • Added validate_url function in libs/infinity_emb/infinity_emb/infinity_server.py to validate URL paths using regex
  • Implemented regex pattern to ensure URL paths start with '/' and don't end with '/'
  • Applied validate_url as a callback to the url_prefix option in the v2 command
  • Added CHECK_TYPER.mark_required() call in the cli function for improved input validation

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

@codecov-commenter
Copy link

codecov-commenter commented Oct 12, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 79.13%. Comparing base (86bd5a6) to head (e24f6a9).

Files with missing lines Patch % Lines
libs/infinity_emb/infinity_emb/infinity_server.py 33.33% 4 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #420      +/-   ##
==========================================
- Coverage   79.22%   79.13%   -0.09%     
==========================================
  Files          40       40              
  Lines        3167     3173       +6     
==========================================
+ Hits         2509     2511       +2     
- Misses        658      662       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michaelfeil michaelfeil merged commit 08e4cc1 into main Oct 13, 2024
36 checks passed
@michaelfeil michaelfeil deleted the fix-pytest-cli branch October 13, 2024 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

url prefix is required to start with /
2 participants